import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path';
import path from 'path'
// https://vitejs.dev/config/


// 引入等比适配插件
const px2rem = require('postcss-px2rem')

// 配置基本大小
const postcss = px2rem({
  // 基准大小 baseSize，需要和rem.js中相同
  remUnit: 16
})






export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, 'src')  //告诉脚手架@是什么，@代表的路径是项目根目录+src
    }

  },

  css: {
    loaderOptions: {
      postcss: {
        plugins: [postcss]
      }
    }
  }
})
